<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Faiss: /data/users/hoss/faiss/IndexPQ.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Faiss
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">/data/users/hoss/faiss/IndexPQ.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) Facebook, Inc. and its affiliates.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * This source code is licensed under the MIT license found in the</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * LICENSE file in the root directory of this source tree.</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">// -*- c++ -*-</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#ifndef FAISS_INDEX_PQ_H</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define FAISS_INDEX_PQ_H</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &quot;Index.h&quot;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &quot;ProductQuantizer.h&quot;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &quot;PolysemousTraining.h&quot;</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="keyword">namespace </span>faiss {</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment">/** Index based on a product quantizer. Stored vectors are</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment"> * approximated by PQ codes. */</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="structfaiss_1_1IndexPQ.html">   26</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structfaiss_1_1IndexPQ.html">IndexPQ</a>: <a class="code" href="structfaiss_1_1Index.html">Index</a> {</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment">    /// The product quantizer used to encode the vectors</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="structfaiss_1_1IndexPQ.html#aa7b7cfe0c8dfd37c8a940fd93d12dc88">   29</a></span>&#160;<span class="comment"></span>    <a class="code" href="structfaiss_1_1ProductQuantizer.html">ProductQuantizer</a> <a class="code" href="structfaiss_1_1IndexPQ.html#aa7b7cfe0c8dfd37c8a940fd93d12dc88">pq</a>;</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment">    /// Codes. Size ntotal * pq.code_size</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="structfaiss_1_1IndexPQ.html#a490b64b12384951ed66548a3a48f91e5">   32</a></span>&#160;<span class="comment"></span>    std::vector&lt;uint8_t&gt; <a class="code" href="structfaiss_1_1IndexPQ.html#a490b64b12384951ed66548a3a48f91e5">codes</a>;</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="comment">    /** Constructor.</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="comment">     *</span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="comment">     * @param d      dimensionality of the input vectors</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="comment">     * @param M      number of subquantizers</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="comment">     * @param nbits  number of bit per subvector index</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    <a class="code" href="structfaiss_1_1IndexPQ.html">IndexPQ</a> (<span class="keywordtype">int</span> <a class="code" href="structfaiss_1_1Index.html#a2a002388d2c081c2dbab8508dcefe73d">d</a>,                    <span class="comment">///&lt; dimensionality of the input vectors</span></div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="comment"></span>             <span class="keywordtype">size_t</span> M,                 <span class="comment">///&lt; number of subquantizers</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="comment"></span>             <span class="keywordtype">size_t</span> nbits,             <span class="comment">///&lt; number of bit per subvector index</span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="comment"></span>             <a class="code" href="namespacefaiss.html#afd12191c638da74760ff397cf319752c">MetricType</a> metric = METRIC_L2);</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    <a class="code" href="structfaiss_1_1IndexPQ.html">IndexPQ</a> ();</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1IndexPQ.html#a87898add5ab4d86ba901ca79778fc11e">train</a>(<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span>* x) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1IndexPQ.html#ac72c9b93f8fe7e5ec27fbe26bb38a7bf">add</a>(<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span>* x) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1IndexPQ.html#a491ba3ed34093513e6a850fbca0abdd2">search</a>(</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;        <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> n,</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">float</span>* x,</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> k,</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;        <span class="keywordtype">float</span>* distances,</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;        <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a>* labels) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1IndexPQ.html#a25e17da885cf55d84b176b46f3ad25b1">reset</a>() <span class="keyword">override</span>;</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1IndexPQ.html#a99b187b1231a700617f7b228ec348ade">reconstruct_n</a>(<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> i0, <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> ni, <span class="keywordtype">float</span>* recons) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1IndexPQ.html#a20913df3bfd8caa5187112641e8d9bc7">reconstruct</a>(<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> key, <span class="keywordtype">float</span>* recons) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="keywordtype">long</span> <a class="code" href="structfaiss_1_1IndexPQ.html#aa98b5481bf171d3ca6733e2d9e9ce4f6">remove_ids</a>(<span class="keyword">const</span> <a class="code" href="structfaiss_1_1IDSelector.html">IDSelector</a>&amp; sel) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="comment">/******************************************************</span></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="comment">     * Polysemous codes implementation</span></div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="comment">     ******************************************************/</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="structfaiss_1_1IndexPQ.html#af616e1f3c7bff7f62c2607b8079da43f">   69</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="structfaiss_1_1IndexPQ.html#af616e1f3c7bff7f62c2607b8079da43f">do_polysemous_training</a>; <span class="comment">///&lt; false = standard PQ</span></div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="comment"></span><span class="comment"></span></div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="comment">    /// parameters used for the polysemous training</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="structfaiss_1_1IndexPQ.html#a820cec27d1ef14bf59fb288b2e143b6a">   72</a></span>&#160;<span class="comment"></span>    <a class="code" href="structfaiss_1_1PolysemousTraining.html">PolysemousTraining</a> <a class="code" href="structfaiss_1_1IndexPQ.html#a820cec27d1ef14bf59fb288b2e143b6a">polysemous_training</a>;</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="comment">    /// how to perform the search in search_core</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fe">   75</a></span>&#160;<span class="comment"></span>    <span class="keyword">enum</span> <a class="code" href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fe">Search_type_t</a> {</div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fea00f77a4f8209c30c3ef37ccfd3d0c10a">   76</a></span>&#160;        <a class="code" href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fea00f77a4f8209c30c3ef37ccfd3d0c10a">ST_PQ</a>,             <span class="comment">///&lt; asymmetric product quantizer (default)</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fea903849f87cca2e7fbbfe034edbb81718">   77</a></span>&#160;<span class="comment"></span>        <a class="code" href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fea903849f87cca2e7fbbfe034edbb81718">ST_HE</a>,             <span class="comment">///&lt; Hamming distance on codes</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fea237afca36629dae511c0ac56effbfaa6">   78</a></span>&#160;<span class="comment"></span>        <a class="code" href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fea237afca36629dae511c0ac56effbfaa6">ST_generalized_HE</a>, <span class="comment">///&lt; nb of same codes</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fea4287cbc83d1d5f0d1a02f014e5fe692c">   79</a></span>&#160;<span class="comment"></span>        <a class="code" href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fea4287cbc83d1d5f0d1a02f014e5fe692c">ST_SDC</a>,            <span class="comment">///&lt; symmetric product quantizer (SDC)</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42feaf06a0e6b53f9cbe1c791c6912169b738">   80</a></span>&#160;<span class="comment"></span>        <a class="code" href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42feaf06a0e6b53f9cbe1c791c6912169b738">ST_polysemous</a>,     <span class="comment">///&lt; HE filter (using ht) + PQ combination</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42feaef79af61798670a362434b7bc9ced45e">   81</a></span>&#160;<span class="comment"></span>        <a class="code" href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42feaef79af61798670a362434b7bc9ced45e">ST_polysemous_generalize</a>,  <span class="comment">///&lt; Filter on generalized Hamming</span></div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="comment"></span>    };</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <a class="code" href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fe">Search_type_t</a> search_type;</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <span class="comment">// just encode the sign of the components, instead of using the PQ encoder</span></div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    <span class="comment">// used only for the queries</span></div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <span class="keywordtype">bool</span> encode_signs;</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="comment">    /// Hamming threshold used for polysemy</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="structfaiss_1_1IndexPQ.html#aff455f2adff6064939494dad6e3017bc">   91</a></span>&#160;<span class="comment"></span>    <span class="keywordtype">int</span> <a class="code" href="structfaiss_1_1IndexPQ.html#aff455f2adff6064939494dad6e3017bc">polysemous_ht</a>;</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <span class="comment">// actual polysemous search</span></div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="keywordtype">void</span> search_core_polysemous (<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span> *x, <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> k,</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;                               <span class="keywordtype">float</span> *distances, <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> *labels) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;<span class="comment">    /// prepare query for a polysemous search, but instead of</span></div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="comment">    /// computing the result, just get the histogram of Hamming</span></div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="comment">    /// distances. May be computed on a provided dataset if xb != NULL</span></div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="comment">    /// @param dist_histogram (M * nbits + 1)</span></div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1IndexPQ.html#ada06f5db85c91a4c140119a5897c6064">hamming_distance_histogram</a> (<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span> *x,</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;                                     <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> nb, <span class="keyword">const</span> <span class="keywordtype">float</span> *xb,</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;                                     <span class="keywordtype">long</span> *dist_histogram);</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;<span class="comment">    /** compute pairwise distances between queries and database</span></div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;<span class="comment">     *</span></div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<span class="comment">     * @param n    nb of query vectors</span></div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;<span class="comment">     * @param x    query vector, size n * d</span></div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;<span class="comment">     * @param dis  output distances, size n * ntotal</span></div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1IndexPQ.html#aa131767383619bb5848b131502ada9cf">hamming_distance_table</a> (<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span> *x,</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;                                 int32_t *dis) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;};</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;<span class="comment">/// statistics are robust to internal threading, but not if</span></div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;<span class="comment">/// IndexPQ::search is called by multiple threads</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="structfaiss_1_1IndexPQStats.html">  119</a></span>&#160;<span class="comment"></span><span class="keyword">struct </span><a class="code" href="structfaiss_1_1IndexPQStats.html">IndexPQStats</a> {</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <span class="keywordtype">size_t</span> nq;       <span class="comment">// nb of queries run</span></div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    <span class="keywordtype">size_t</span> ncode;    <span class="comment">// nb of codes visited</span></div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="keywordtype">size_t</span> n_hamming_pass; <span class="comment">// nb of passed Hamming distance tests (for polysemy)</span></div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    <a class="code" href="structfaiss_1_1IndexPQStats.html">IndexPQStats</a> () {reset (); }</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="keywordtype">void</span> reset ();</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;};</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;<span class="keyword">extern</span> <a class="code" href="structfaiss_1_1IndexPQStats.html">IndexPQStats</a> indexPQ_stats;</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;<span class="comment">/** Quantizer where centroids are virtual: they are the Cartesian</span></div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;<span class="comment"> *  product of sub-centroids. */</span></div>
<div class="line"><a name="l00135"></a><span class="lineno"><a class="line" href="structfaiss_1_1MultiIndexQuantizer.html">  135</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structfaiss_1_1MultiIndexQuantizer.html">MultiIndexQuantizer</a>: <a class="code" href="structfaiss_1_1Index.html">Index</a>  {</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    <a class="code" href="structfaiss_1_1ProductQuantizer.html">ProductQuantizer</a> pq;</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    <a class="code" href="structfaiss_1_1MultiIndexQuantizer.html">MultiIndexQuantizer</a> (<span class="keywordtype">int</span> <a class="code" href="structfaiss_1_1Index.html#a2a002388d2c081c2dbab8508dcefe73d">d</a>,         <span class="comment">///&lt; dimension of the input vectors</span></div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;<span class="comment"></span>                         <span class="keywordtype">size_t</span> M,      <span class="comment">///&lt; number of subquantizers</span></div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;<span class="comment"></span>                         <span class="keywordtype">size_t</span> nbits); <span class="comment">///&lt; number of bit per subvector index</span></div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1MultiIndexQuantizer.html#a6fa1d1a295eb2d4377b8de5096ab3ef4">train</a>(<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span>* x) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1MultiIndexQuantizer.html#a999ee03f4e65f453377e209d10e25681">search</a>(</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;        <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span>* x, <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> k,</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;        <span class="keywordtype">float</span>* distances, <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a>* labels) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;<span class="comment">    /// add and reset will crash at runtime</span></div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;<span class="comment"></span>    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1MultiIndexQuantizer.html#aa72640bcbe2e5d9029954c2fa6633453">add</a>(<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span>* x) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1MultiIndexQuantizer.html#a4808ce22fcc95c7af902b97969f2a90d">reset</a>() <span class="keyword">override</span>;</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    <a class="code" href="structfaiss_1_1MultiIndexQuantizer.html">MultiIndexQuantizer</a> () {}</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1MultiIndexQuantizer.html#aa5bd578560419955a4bf7035cf09a392">reconstruct</a>(<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> key, <span class="keywordtype">float</span>* recons) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;};</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;<span class="comment">/** MultiIndexQuantizer where the PQ assignmnet is performed by sub-indexes</span></div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00160"></a><span class="lineno"><a class="line" href="structfaiss_1_1MultiIndexQuantizer2.html">  160</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structfaiss_1_1MultiIndexQuantizer2.html">MultiIndexQuantizer2</a>: <a class="code" href="structfaiss_1_1MultiIndexQuantizer.html">MultiIndexQuantizer</a> {</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;<span class="comment">    /// M Indexes on d / M dimensions</span></div>
<div class="line"><a name="l00163"></a><span class="lineno"><a class="line" href="structfaiss_1_1MultiIndexQuantizer2.html#a7e5f4079fdca73aeab239d3c85c100da">  163</a></span>&#160;<span class="comment"></span>    std::vector&lt;Index*&gt; <a class="code" href="structfaiss_1_1MultiIndexQuantizer2.html#a7e5f4079fdca73aeab239d3c85c100da">assign_indexes</a>;</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    <span class="keywordtype">bool</span> own_fields;</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    <a class="code" href="structfaiss_1_1MultiIndexQuantizer2.html">MultiIndexQuantizer2</a> (</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;        <span class="keywordtype">int</span> <a class="code" href="structfaiss_1_1Index.html#a2a002388d2c081c2dbab8508dcefe73d">d</a>, <span class="keywordtype">size_t</span> M, <span class="keywordtype">size_t</span> nbits,</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;        <a class="code" href="structfaiss_1_1Index.html">Index</a> **indexes);</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <a class="code" href="structfaiss_1_1MultiIndexQuantizer2.html">MultiIndexQuantizer2</a> (</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;        <span class="keywordtype">int</span> <a class="code" href="structfaiss_1_1Index.html#a2a002388d2c081c2dbab8508dcefe73d">d</a>, <span class="keywordtype">size_t</span> nbits,</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;        <a class="code" href="structfaiss_1_1Index.html">Index</a> *assign_index_0,</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;        <a class="code" href="structfaiss_1_1Index.html">Index</a> *assign_index_1);</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1MultiIndexQuantizer2.html#a553b9a33e9be7f231ffdc0ac53c59e7c">train</a>(<a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span>* x) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structfaiss_1_1MultiIndexQuantizer2.html#adff25d40c18f5d7a65d359d1cd80ea29">search</a>(</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;        <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> n, <span class="keyword">const</span> <span class="keywordtype">float</span>* x, <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a> k,</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;        <span class="keywordtype">float</span>* distances, <a class="code" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">idx_t</a>* labels) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;};</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;} <span class="comment">// namespace faiss</span></div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_a490b64b12384951ed66548a3a48f91e5"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#a490b64b12384951ed66548a3a48f91e5">faiss::IndexPQ::codes</a></div><div class="ttdeci">std::vector&lt; uint8_t &gt; codes</div><div class="ttdoc">Codes. Size ntotal * pq.code_size. </div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8h_source.html#l00032">IndexPQ.h:32</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQStats_html"><div class="ttname"><a href="structfaiss_1_1IndexPQStats.html">faiss::IndexPQStats</a></div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8h_source.html#l00119">IndexPQ.h:119</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_a4fa05430935a02b62b7c15c9840c42fea903849f87cca2e7fbbfe034edbb81718"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fea903849f87cca2e7fbbfe034edbb81718">faiss::IndexPQ::ST_HE</a></div><div class="ttdoc">Hamming distance on codes. </div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8h_source.html#l00077">IndexPQ.h:77</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_af616e1f3c7bff7f62c2607b8079da43f"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#af616e1f3c7bff7f62c2607b8079da43f">faiss::IndexPQ::do_polysemous_training</a></div><div class="ttdeci">bool do_polysemous_training</div><div class="ttdoc">false = standard PQ </div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8h_source.html#l00069">IndexPQ.h:69</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_a87898add5ab4d86ba901ca79778fc11e"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#a87898add5ab4d86ba901ca79778fc11e">faiss::IndexPQ::train</a></div><div class="ttdeci">void train(idx_t n, const float *x) override</div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8cpp_source.html#l00052">IndexPQ.cpp:52</a></div></div>
<div class="ttc" id="structfaiss_1_1MultiIndexQuantizer_html_a4808ce22fcc95c7af902b97969f2a90d"><div class="ttname"><a href="structfaiss_1_1MultiIndexQuantizer.html#a4808ce22fcc95c7af902b97969f2a90d">faiss::MultiIndexQuantizer::reset</a></div><div class="ttdeci">void reset() override</div><div class="ttdoc">removes all elements from the database. </div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8cpp_source.html#l00958">IndexPQ.cpp:958</a></div></div>
<div class="ttc" id="structfaiss_1_1MultiIndexQuantizer_html_a6fa1d1a295eb2d4377b8de5096ab3ef4"><div class="ttname"><a href="structfaiss_1_1MultiIndexQuantizer.html#a6fa1d1a295eb2d4377b8de5096ab3ef4">faiss::MultiIndexQuantizer::train</a></div><div class="ttdeci">void train(idx_t n, const float *x) override</div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8cpp_source.html#l00856">IndexPQ.cpp:856</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html">faiss::IndexPQ</a></div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8h_source.html#l00026">IndexPQ.h:26</a></div></div>
<div class="ttc" id="structfaiss_1_1IDSelector_html"><div class="ttname"><a href="structfaiss_1_1IDSelector.html">faiss::IDSelector</a></div><div class="ttdef"><b>Definition:</b> <a href="AuxIndexStructures_8h_source.html#l00054">AuxIndexStructures.h:54</a></div></div>
<div class="ttc" id="structfaiss_1_1Index_html_a2a002388d2c081c2dbab8508dcefe73d"><div class="ttname"><a href="structfaiss_1_1Index.html#a2a002388d2c081c2dbab8508dcefe73d">faiss::Index::d</a></div><div class="ttdeci">int d</div><div class="ttdoc">vector dimension </div><div class="ttdef"><b>Definition:</b> <a href="Index_8h_source.html#l00066">Index.h:66</a></div></div>
<div class="ttc" id="structfaiss_1_1Index_html_ad3f0d3071f987baabbdd3da4500c87ea"><div class="ttname"><a href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">faiss::Index::idx_t</a></div><div class="ttdeci">long idx_t</div><div class="ttdoc">all indices are this type </div><div class="ttdef"><b>Definition:</b> <a href="Index_8h_source.html#l00062">Index.h:62</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_ada06f5db85c91a4c140119a5897c6064"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#ada06f5db85c91a4c140119a5897c6064">faiss::IndexPQ::hamming_distance_histogram</a></div><div class="ttdeci">void hamming_distance_histogram(idx_t n, const float *x, idx_t nb, const float *xb, long *dist_histogram)</div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8cpp_source.html#l00411">IndexPQ.cpp:411</a></div></div>
<div class="ttc" id="structfaiss_1_1MultiIndexQuantizer2_html_a553b9a33e9be7f231ffdc0ac53c59e7c"><div class="ttname"><a href="structfaiss_1_1MultiIndexQuantizer2.html#a553b9a33e9be7f231ffdc0ac53c59e7c">faiss::MultiIndexQuantizer2::train</a></div><div class="ttdeci">void train(idx_t n, const float *x) override</div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8cpp_source.html#l01010">IndexPQ.cpp:1010</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_a4fa05430935a02b62b7c15c9840c42fe"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fe">faiss::IndexPQ::Search_type_t</a></div><div class="ttdeci">Search_type_t</div><div class="ttdoc">how to perform the search in search_core </div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8h_source.html#l00075">IndexPQ.h:75</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_aa98b5481bf171d3ca6733e2d9e9ce4f6"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#aa98b5481bf171d3ca6733e2d9e9ce4f6">faiss::IndexPQ::remove_ids</a></div><div class="ttdeci">long remove_ids(const IDSelector &amp;sel) override</div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8cpp_source.html#l00085">IndexPQ.cpp:85</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_a4fa05430935a02b62b7c15c9840c42feaef79af61798670a362434b7bc9ced45e"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42feaef79af61798670a362434b7bc9ced45e">faiss::IndexPQ::ST_polysemous_generalize</a></div><div class="ttdoc">Filter on generalized Hamming. </div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8h_source.html#l00081">IndexPQ.h:81</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_aa7b7cfe0c8dfd37c8a940fd93d12dc88"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#aa7b7cfe0c8dfd37c8a940fd93d12dc88">faiss::IndexPQ::pq</a></div><div class="ttdeci">ProductQuantizer pq</div><div class="ttdoc">The product quantizer used to encode the vectors. </div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8h_source.html#l00029">IndexPQ.h:29</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_ac72c9b93f8fe7e5ec27fbe26bb38a7bf"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#ac72c9b93f8fe7e5ec27fbe26bb38a7bf">faiss::IndexPQ::add</a></div><div class="ttdeci">void add(idx_t n, const float *x) override</div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8cpp_source.html#l00076">IndexPQ.cpp:76</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_a4fa05430935a02b62b7c15c9840c42fea237afca36629dae511c0ac56effbfaa6"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fea237afca36629dae511c0ac56effbfaa6">faiss::IndexPQ::ST_generalized_HE</a></div><div class="ttdoc">nb of same codes </div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8h_source.html#l00078">IndexPQ.h:78</a></div></div>
<div class="ttc" id="structfaiss_1_1PolysemousTraining_html"><div class="ttname"><a href="structfaiss_1_1PolysemousTraining.html">faiss::PolysemousTraining</a></div><div class="ttdoc">optimizes the order of indices in a ProductQuantizer </div><div class="ttdef"><b>Definition:</b> <a href="PolysemousTraining_8h_source.html#l00121">PolysemousTraining.h:121</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_aa131767383619bb5848b131502ada9cf"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#aa131767383619bb5848b131502ada9cf">faiss::IndexPQ::hamming_distance_table</a></div><div class="ttdeci">void hamming_distance_table(idx_t n, const float *x, int32_t *dis) const </div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8cpp_source.html#l00399">IndexPQ.cpp:399</a></div></div>
<div class="ttc" id="structfaiss_1_1MultiIndexQuantizer_html_a999ee03f4e65f453377e209d10e25681"><div class="ttname"><a href="structfaiss_1_1MultiIndexQuantizer.html#a999ee03f4e65f453377e209d10e25681">faiss::MultiIndexQuantizer::search</a></div><div class="ttdeci">void search(idx_t n, const float *x, idx_t k, float *distances, idx_t *labels) const override</div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8cpp_source.html#l00868">IndexPQ.cpp:868</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_a20913df3bfd8caa5187112641e8d9bc7"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#a20913df3bfd8caa5187112641e8d9bc7">faiss::IndexPQ::reconstruct</a></div><div class="ttdeci">void reconstruct(idx_t key, float *recons) const override</div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8cpp_source.html#l00123">IndexPQ.cpp:123</a></div></div>
<div class="ttc" id="structfaiss_1_1MultiIndexQuantizer_html"><div class="ttname"><a href="structfaiss_1_1MultiIndexQuantizer.html">faiss::MultiIndexQuantizer</a></div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8h_source.html#l00135">IndexPQ.h:135</a></div></div>
<div class="ttc" id="structfaiss_1_1MultiIndexQuantizer2_html"><div class="ttname"><a href="structfaiss_1_1MultiIndexQuantizer2.html">faiss::MultiIndexQuantizer2</a></div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8h_source.html#l00160">IndexPQ.h:160</a></div></div>
<div class="ttc" id="structfaiss_1_1Index_html"><div class="ttname"><a href="structfaiss_1_1Index.html">faiss::Index</a></div><div class="ttdef"><b>Definition:</b> <a href="Index_8h_source.html#l00061">Index.h:61</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_a99b187b1231a700617f7b228ec348ade"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#a99b187b1231a700617f7b228ec348ade">faiss::IndexPQ::reconstruct_n</a></div><div class="ttdeci">void reconstruct_n(idx_t i0, idx_t ni, float *recons) const override</div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8cpp_source.html#l00113">IndexPQ.cpp:113</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_a4fa05430935a02b62b7c15c9840c42fea00f77a4f8209c30c3ef37ccfd3d0c10a"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fea00f77a4f8209c30c3ef37ccfd3d0c10a">faiss::IndexPQ::ST_PQ</a></div><div class="ttdoc">asymmetric product quantizer (default) </div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8h_source.html#l00076">IndexPQ.h:76</a></div></div>
<div class="ttc" id="structfaiss_1_1MultiIndexQuantizer_html_aa5bd578560419955a4bf7035cf09a392"><div class="ttname"><a href="structfaiss_1_1MultiIndexQuantizer.html#aa5bd578560419955a4bf7035cf09a392">faiss::MultiIndexQuantizer::reconstruct</a></div><div class="ttdeci">void reconstruct(idx_t key, float *recons) const override</div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8cpp_source.html#l00940">IndexPQ.cpp:940</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_a4fa05430935a02b62b7c15c9840c42feaf06a0e6b53f9cbe1c791c6912169b738"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42feaf06a0e6b53f9cbe1c791c6912169b738">faiss::IndexPQ::ST_polysemous</a></div><div class="ttdoc">HE filter (using ht) + PQ combination. </div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8h_source.html#l00080">IndexPQ.h:80</a></div></div>
<div class="ttc" id="structfaiss_1_1MultiIndexQuantizer2_html_adff25d40c18f5d7a65d359d1cd80ea29"><div class="ttname"><a href="structfaiss_1_1MultiIndexQuantizer2.html#adff25d40c18f5d7a65d359d1cd80ea29">faiss::MultiIndexQuantizer2::search</a></div><div class="ttdeci">void search(idx_t n, const float *x, idx_t k, float *distances, idx_t *labels) const override</div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8cpp_source.html#l01020">IndexPQ.cpp:1020</a></div></div>
<div class="ttc" id="structfaiss_1_1ProductQuantizer_html"><div class="ttname"><a href="structfaiss_1_1ProductQuantizer.html">faiss::ProductQuantizer</a></div><div class="ttdef"><b>Definition:</b> <a href="ProductQuantizer_8h_source.html#l00023">ProductQuantizer.h:23</a></div></div>
<div class="ttc" id="structfaiss_1_1MultiIndexQuantizer_html_aa72640bcbe2e5d9029954c2fa6633453"><div class="ttname"><a href="structfaiss_1_1MultiIndexQuantizer.html#aa72640bcbe2e5d9029954c2fa6633453">faiss::MultiIndexQuantizer::add</a></div><div class="ttdeci">void add(idx_t n, const float *x) override</div><div class="ttdoc">add and reset will crash at runtime </div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8cpp_source.html#l00952">IndexPQ.cpp:952</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_a25e17da885cf55d84b176b46f3ad25b1"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#a25e17da885cf55d84b176b46f3ad25b1">faiss::IndexPQ::reset</a></div><div class="ttdeci">void reset() override</div><div class="ttdoc">removes all elements from the database. </div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8cpp_source.html#l00107">IndexPQ.cpp:107</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_a491ba3ed34093513e6a850fbca0abdd2"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#a491ba3ed34093513e6a850fbca0abdd2">faiss::IndexPQ::search</a></div><div class="ttdeci">void search(idx_t n, const float *x, idx_t k, float *distances, idx_t *labels) const override</div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8cpp_source.html#l00143">IndexPQ.cpp:143</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_a4fa05430935a02b62b7c15c9840c42fea4287cbc83d1d5f0d1a02f014e5fe692c"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#a4fa05430935a02b62b7c15c9840c42fea4287cbc83d1d5f0d1a02f014e5fe692c">faiss::IndexPQ::ST_SDC</a></div><div class="ttdoc">symmetric product quantizer (SDC) </div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8h_source.html#l00079">IndexPQ.h:79</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_aff455f2adff6064939494dad6e3017bc"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#aff455f2adff6064939494dad6e3017bc">faiss::IndexPQ::polysemous_ht</a></div><div class="ttdeci">int polysemous_ht</div><div class="ttdoc">Hamming threshold used for polysemy. </div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8h_source.html#l00091">IndexPQ.h:91</a></div></div>
<div class="ttc" id="structfaiss_1_1IndexPQ_html_a820cec27d1ef14bf59fb288b2e143b6a"><div class="ttname"><a href="structfaiss_1_1IndexPQ.html#a820cec27d1ef14bf59fb288b2e143b6a">faiss::IndexPQ::polysemous_training</a></div><div class="ttdeci">PolysemousTraining polysemous_training</div><div class="ttdoc">parameters used for the polysemous training </div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8h_source.html#l00072">IndexPQ.h:72</a></div></div>
<div class="ttc" id="structfaiss_1_1MultiIndexQuantizer2_html_a7e5f4079fdca73aeab239d3c85c100da"><div class="ttname"><a href="structfaiss_1_1MultiIndexQuantizer2.html#a7e5f4079fdca73aeab239d3c85c100da">faiss::MultiIndexQuantizer2::assign_indexes</a></div><div class="ttdeci">std::vector&lt; Index * &gt; assign_indexes</div><div class="ttdoc">M Indexes on d / M dimensions. </div><div class="ttdef"><b>Definition:</b> <a href="IndexPQ_8h_source.html#l00163">IndexPQ.h:163</a></div></div>
<div class="ttc" id="namespacefaiss_html_afd12191c638da74760ff397cf319752c"><div class="ttname"><a href="namespacefaiss.html#afd12191c638da74760ff397cf319752c">faiss::MetricType</a></div><div class="ttdeci">MetricType</div><div class="ttdoc">Some algorithms support both an inner product version and a L2 search version. </div><div class="ttdef"><b>Definition:</b> <a href="Index_8h_source.html#l00044">Index.h:44</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
